//
//  MeTableViewCellOfInformation.m
//  LOLer
//
//  Created by kaijie on 16/4/1.
//  Copyright © 2016年 kaijie. All rights reserved.
//

#import "MeTableViewCellOfInformation.h"

@implementation MeTableViewCellOfInformation
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    return self;
}
-(void)setupViews{
    [self.contentView addSubview:self.imageViewOfHeard];
    [self.contentView addSubview:self.labelOfName];
    [self.contentView addSubview:self.labelOfLove];
    [self.contentView addSubview:self.labelOfState];
    [self.contentView addSubview:self.buttonOfCalendar];
    [_buttonOfCalendar addSubview:self.imageViewOfOne];
    
}
-(void)addViewsConstraints{
    [_imageViewOfHeard mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView.mas_top).offset(8);
        make.height.width.mas_equalTo(40);
        make.bottom.equalTo(self.contentView.mas_bottom).offset(-8);
        make.leading.equalTo(self.contentView.mas_leading).offset(10);
        
    }];
    [_labelOfName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.imageViewOfHeard.mas_top).offset(2);
        make.leading.equalTo(self.imageViewOfHeard.mas_trailing).offset(8);
        make.bottom.equalTo(self.imageViewOfHeard.mas_centerY).offset(-2);
        
    }];
    [_labelOfLove mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.equalTo(_labelOfName);
        make.top.equalTo(_imageViewOfHeard.mas_centerY).offset(2);
        make.bottom.equalTo(_imageViewOfHeard.mas_bottom).offset(-4);
    }];
    [_labelOfState mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.equalTo(self.labelOfLove);
        make.leading.equalTo(self.labelOfLove.mas_trailing).offset(20);
    }];
    [_buttonOfCalendar mas_makeConstraints:^(MASConstraintMaker *make) {
        make.trailing.equalTo(self.contentView.mas_trailing).offset(-10);
        make.top.equalTo(self.contentView.mas_top).offset(10);
        make.bottom.equalTo(self.contentView.mas_bottom).offset(-10);
        make.width.mas_equalTo(140);
    }];
    [_imageViewOfOne mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.buttonOfCalendar.mas_top).offset(10);
        make.bottom.equalTo(self.buttonOfCalendar.mas_bottom).offset(-8);
        make.leading.equalTo(self.buttonOfCalendar.mas_leading).offset(22);
        make.width.mas_equalTo(15);
    }];
}

-(UIImageView *)imageViewOfHeard{
    if (!_imageViewOfHeard) {
        _imageViewOfHeard=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"4bad77ff467a352dd72d77b00bc12920.jpg"]];
    }return _imageViewOfHeard;
}
-(UILabel *)labelOfName{
    if (!_labelOfName) {
        _labelOfName=[UILabel new];
        _labelOfName.font=[UIFont systemFontOfSize:10];
        _labelOfName.text=@"NineFx丶KJ";
        
    }return _labelOfName;
}
-(UILabel *)labelOfLove{
    if (!_labelOfLove) {
        _labelOfLove=[UILabel new];
        _labelOfLove.text=@"Lv30";
        _labelOfLove.font=[UIFont systemFontOfSize:10];
        [_labelOfLove setTextColor:[UIColor colorWithRed:54/255.f green:115/225.0 blue:178/225.0 alpha:1.0]];

    }return _labelOfLove;
}
-(UILabel *)labelOfState{
    if (!_labelOfState) {
        _labelOfState=[UILabel new];
        _labelOfState.text=@"游戏离线";
        _labelOfState.font=[UIFont systemFontOfSize:10];
        [_labelOfState setTextColor:[UIColor colorWithRed:54/255.f green:115/225.0 blue:178/225.0 alpha:1.0]];
    }return _labelOfState;
}
-(UIButton *)buttonOfCalendar{
    if (!_buttonOfCalendar) {
        _buttonOfCalendar=[UIButton new];
        [_buttonOfCalendar setBackgroundImage:[UIImage imageNamed:@"first_win_calendar_page"] forState:UIControlStateNormal];
        [_buttonOfCalendar setTitle:@"首胜可用 >" forState:UIControlStateNormal];;
        _buttonOfCalendar.titleLabel.font = [UIFont systemFontOfSize:12];
        _buttonOfCalendar.titleLabel.textAlignment = NSTextAlignmentRight;//设置title的字体居中
        
        [_buttonOfCalendar setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
            
    }return _buttonOfCalendar;
}
-(UIImageView *)imageViewOfOne{
    if (!_imageViewOfOne) {
        _imageViewOfOne=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"first_win_calendar_can_use_1"]];
    }return _imageViewOfOne;
}
@end
